<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateChallengeGameLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('challenge_game_logs', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('game_id')->comment('比赛ID');
            $table->integer('type')->comment('类型');
            $table->integer('play_a')->comment('挑战者');
            $table->integer('play_b')->comment('应战者');
            $table->integer('score_a')->comment('挑战者原始积分');
            $table->integer('score_b')->comment('应战者原始积分');
            $table->integer('change_score')->comment('积分变化');
            $table->integer('win_a')->comment('挑战者原始连胜');
            $table->integer('win_b')->comment('应战者原始连胜');
            $table->integer('max_win_a')->comment('挑战者原始最高连胜');
            $table->integer('max_win_b')->comment('应战者原始最高连胜');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('challenge_game_logs');
    }
}
